<script type="text/html" data-template-name="ha-mqtt-device_tracker">
    <div class="form-row">
        <label for="node-input-server" data-i18n="node-red-contrib-ha-mqtt/common:label.mqttServer"></label>
        <select id="node-input-server"></select>
    </div>
    <div class="form-row">
        <label for="node-input-device" data-i18n="node-red-contrib-ha-mqtt/common:label.deviceName"></label>
        <select type="text" id="node-input-device" data-i18n="[placeholder]node-red-contrib-ha-mqtt/common:label.deviceName"></select>
    </div>
    <div class="form-row">
        <label for="node-input-name" data-i18n="node-red-contrib-ha-mqtt/common:label.entityName"></label>
        <input type="text" id="node-input-name" data-i18n="[placeholder]node-red-contrib-ha-mqtt/common:label.entityName">
    </div>
    <div class="form-row">
        <a href="https://www.home-assistant.io/integrations/device_tracker.mqtt/" target="_blank" style="color:blue;">
            <label for="node-input-config" data-i18n="node-red-contrib-ha-mqtt/common:label.config"></label>   
        </a>        
        <input type="text" id="node-input-config" data-i18n="[placeholder]node-red-contrib-ha-mqtt/common:label.config">
    </div>
</script>
<script type="text/javascript">
    RED.nodes.registerType('ha-mqtt-device_tracker', {
        category: RED._("node-red-contrib-ha-mqtt/common:homeAssistantCategory"),
        color: '#C0DEED',
        icon: "font-awesome/fa-user-o",
        paletteLabel: 'Device Tracker',
        defaults: {
            server: { value: "", type: "mqtt-broker", required: true },
            device: { value: "", type: "ha-mqtt-device" , required: true},
            name: { value: "", required: true },
            config: { value: "" }
        },
        inputs: 1,
        outputs: 0,
        inputLabels: RED._("node-red-contrib-ha-mqtt/common:ioLabels.state"),
        label: function () {
            return this.name || "device_tracker";
        },
        oneditprepare: function () {
            $("#node-input-config").typedInput({ type: "json", types: ["json"] })
        }
    });
</script>